<?php
/***************************************************************
*  Copyright notice
*  (c) 2009, jianyuzhu@gmail.com
*  All rights reserved
*  This script is part of the PPEMI project.
***************************************************************/

//
include_once(CONFIG_PATH . CONFIG_DIR_CLASSES . 'frontend.main.class.php');
$feObj = new FrontendMainBase();

//
include_once(CONFIG_PATH . CONFIG_DIR_CLASSES . 'module/content/content.category.class.php');
$mcObj = new ContentCategoryBase();
$mcObj->setQueryLimitLength(10);
$categories = $mcObj->getCategories();
$category = $mcObj->getCategory($request_link_class, 'link');
$feObj->addInject('categories', $categories);
$feObj->addInject('category', $category);

//
if( $category['categories_id'] > 0 ) {
	include_once(CONFIG_PATH . CONFIG_DIR_CLASSES . 'module/content/content.class.php');
	$mObj = new ContentBase();
	$mObj->format = true;
	$filter = array('cid:=' => $category['categories_id']);
	$items = $mObj->getItems($filter, 0, false);
	$feObj->addInject('items', $items);
}

//
echo $feObj->display('pagelayout/pagelayout_content_category.tpl');
//
?>